 
import QtQuick 1.0
//import ShellInvoke 1.0

 Rectangle {
     width: 200; height: 300
     //color: "#1a000000"
     // Define a delegate component.  A component will be
     // instantiated for each visible item in the list.
     Component {
         id: petDelegate
         Item {
             id: wrapper
             width: 200; height: 55
             Column {
                 Text { text: 'Name: ' + name }
                 Text { text: 'Type: ' + type }
                 Text { text: 'Age: ' + age }
             }
             // indent the item if it is the current item
             states: State {
                 name: "Current"
                 when: wrapper.ListView.isCurrentItem
                 PropertyChanges { target: wrapper; x: 20 ;  }
             }
             transitions: Transition {
                 NumberAnimation { properties: "x"; duration: 200 }
             }
         }
     }

  /*  ShellInvoke {
      id:invoker
    }
    */
     // Define a highlight with customised movement between items.
     Component {
         id: highlightBar
         Rectangle {
             width: 200; height: 50
             color: "#FFFF88"
             y: listView.currentItem.y;
             Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
         }
     }

    
     ListView {
         id: listView
         width: 200; height: parent.height

         model: PetsModel {}
         delegate: petDelegate
         focus: true
	  Keys.onPressed: {
		if (event.key == Qt.Key_Return) {
		  //invoker.shellAction("smplayer", ["/home/emugwaneza/Vidéos/Babysitters (2007) Dra.avi"]);  
		  // Qt.quit();
		}
	    }
         // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
         // to false so the highlight delegate can control how the highlight is moved.
         highlight: highlightBar
         highlightFollowsCurrentItem: false
     }
 }